home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Graphic Elements 3
/
GEDemo
/
Meter.c
< prev
next >
Wrap
Text File
|
1995-08-28
|
959b
|
42 lines
/*
Meter.h
System Use meter for GEDemo
Copyright 1993 by Al Evans. All rights reserved.
11/5/93
*/
#include "Meter.h"
Boolean LoadUsageMeterScene(GEWorldPtr world)
{
GrafElPtr meterBkg, thisElement;
//Get meter bkg picture
meterBkg = NewBasicPICT(world, meterBkgID, meterPlane, rMeterBkg,
transparent, meterLeft, meterTop);
if (meterBkg == nil) return false;
//Get Indicator picture
thisElement = NewScrollingGraphic(world, meterIndID, indPlane, rMeterInd,
srcCopy, indLeft, indTop);
if (thisElement == nil) return false;
//Show only top 10 pixels of indicator
thisElement->animationRect.bottom = thisElement->animationRect.top + ScaleToWorld(world, 10);
//Connect indicator to bkg
meterBkg->slaveGrafEl = thisElement;
return true;
}
pascal void SetMeterReading(GEWorldPtr world, short percent)
{
if (percent < 0) percent = 0;
if (percent > 100) percent = 100;
SetScroll(world, meterIndID, 0, percent);
}